<template>
  <div>
    <h3>我是子组件</h3>
    <p>{{ count }}</p>
    <button @click="updateCount(100)">修改count</button>
  </div>
</template>

<script setup>
import { inject } from "vue";

// inject是注入的意思
const count = inject("count");
const updateCount = inject("updateCount");
</script>

<style lang="scss" scoped>
</style>